package interfaceDemo

import "fmt"

type Person interface {
	SayHello() string
}

type InterfacePerson struct {
	Name string
}

func (p *InterfacePerson) SayHello() {
	println(p.Name, "hello world")
}

type name string

func SayHello(n name) {
	println(n, "hello world")
}

// @ 2024 08 19
// Sayer 接口
type Sayer interface {
	Say()
}

// Mover 接口
type Mover interface {
	Move()
}

type Dog struct {
	Name string
}

// 实现Sayer接口
func (d Dog) Say() {
	fmt.Printf("%s会叫汪汪汪\n", d.Name)
}

// 实现Mover接口
func (d Dog) Move() {
	fmt.Printf("%s会动\n", d.Name)
}
